<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?:'main';
if($_RQ['op']=='main'){
	//这里整理跳转到游戏页面
	$id=intval($_RQ['id']);
	$wait=pdo_get('jy_weishop_game_wait',array('id'=>$id));
	$game=pdo_get('jy_weishop_game',array('id'=>$wait['game_id']),array('id','game_id','plugin_name'));
	$wait['game_id']=$game['id'];
	$backurl=($_SESSION['current_plugin'] && $_SESSION['current_plugin']!='core')?$_SESSION['current_plugin']:'jy_weishop';
	if(!$game['id']){
		exi('没找到该游戏活动！','error','goback');
	}
	if($game['plugin_name'] && $game['plugin_name']!='jy_h5game'){
		exi('','',$game['plugin_name'].'/game//id'.$game['id'],true);
	}else{
		if(!$game['game_id']){
			exi('没找到该游戏活动！','error',$backurl.'/index/');
		}
		//接下来跳转到游戏首页
		exi('','',custom_url('jy_h5game/welcome/reply/wait_id='.$wait['id'].'&backurl='.$backurl,true));
	}
}